package exception;
/**
 * throws的演示
 */
public class TrowsDemo {
    public static void main(String[] args) {
        /*

         */
        Student zs = new Student();
        try {
            zs.setAge(1000);
            System.out.println("此人年龄为"+zs.getAge()+"岁了");
        } catch (IllegalAgeException e) {
            e.printStackTrace();//打印错误堆栈跟踪信息
            System.out.println(e.getMessage());//获取错误信息并输出
        }
    }
}
